<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>运行时配置</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="info.installation.html">« 安装</a></li>
      <li style="float: right;"><a href="info.resources.html">资源类型 »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="info.setup.html">安装/配置</a></li>
    <li>运行时配置</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="info.configuration" class="section">
 <h2 class="title">运行时配置</h2>
 <p class="simpara">
这些函数的行为受 <var class="filename">php.ini</var> 中的设置影响。
</p>
 <p class="para">
  <table class="doctable table">
   <caption><strong>PHP 选项/ Info 配置选项</strong></caption>
   
    <thead>
     <tr>
      <th>名字</th>
      <th>默认</th>
      <th>可修改范围</th>
      <th>更新日志</th>
     </tr>

    </thead>

    <tbody class="tbody">
    <tr>
     <td><a href="info.configuration.html#ini.assert.active" class="link">assert.active</a></td>
     <td>&quot;1&quot;</td>
     <td>PHP_INI_ALL</td>
     <td class="empty">&nbsp;</td>
    </tr>

    <tr>
     <td><a href="info.configuration.html#ini.assert.bail" class="link">assert.bail</a></td>
     <td>&quot;0&quot;</td>
     <td>PHP_INI_ALL</td>
     <td class="empty">&nbsp;</td>
    </tr>

    <tr>
     <td><a href="info.configuration.html#ini.assert.warning" class="link">assert.warning</a></td>
     <td>&quot;1&quot;</td>
     <td>PHP_INI_ALL</td>
     <td class="empty">&nbsp;</td>
    </tr>

    <tr>
     <td><a href="info.configuration.html#ini.assert.callback" class="link">assert.callback</a></td>
     <td>NULL</td>
     <td>PHP_INI_ALL</td>
     <td class="empty">&nbsp;</td>
    </tr>

    <tr>
     <td><a href="info.configuration.html#ini.assert.quiet-eval" class="link">assert.quiet_eval</a></td>
     <td>&quot;0&quot;</td>
     <td>PHP_INI_ALL</td>
     <td class="empty">&nbsp;</td>
    </tr>

    <tr>
     <td><a href="info.configuration.html#ini.assert.exception" class="link">assert.exception</a></td>
     <td>&quot;0&quot;</td>
     <td>PHP_INI_ALL</td>
     <td>自 PHP 7.0.0 起有效。</td>
    </tr>

    <tr>
     <td><a href="info.configuration.html#ini.enable-dl" class="link">enable_dl</a></td>
     <td>&quot;1&quot;</td>
     <td>PHP_INI_SYSTEM</td>
     <td>本过时特性<em class="emphasis">将</em>肯定会在未来被<em class="emphasis">移除</em>。</td>
    </tr>

    <tr>
     <td><a href="info.configuration.html#ini.max-execution-time" class="link">max_execution_time</a></td>
     <td>&quot;30&quot;</td>
     <td>PHP_INI_ALL</td>
     <td class="empty">&nbsp;</td>
    </tr>

    <tr>
     <td><a href="info.configuration.html#ini.max-input-time" class="link">max_input_time</a></td>
     <td>&quot;-1&quot;</td>
     <td>PHP_INI_PERDIR</td>
     <td class="empty">&nbsp;</td>
    </tr>

    <tr>
     <td><a href="info.configuration.html#ini.max-input-nesting-level" class="link">max_input_nesting_level</a></td>
     <td>&quot;64&quot;</td>
     <td>PHP_INI_PERDIR</td>
     <td>自 PHP 5.2.3 起有效。</td>
    </tr>

    <tr>
     <td><a href="info.configuration.html#ini.max-input-vars" class="link">max_input_vars</a></td>
     <td>1000</td>
     <td>PHP_INI_PERDIR</td>
     <td>自 PHP 5.3.9 起有效。</td>
    </tr>

    <tr>
     <td><a href="info.configuration.html#ini.magic-quotes-gpc" class="link">magic_quotes_gpc</a></td>
     <td>&quot;1&quot;</td>
     <td>PHP_INI_PERDIR</td>
     <td>在 PHP 5.4.0 中被移除。</td>
    </tr>

    <tr>
     <td><a href="info.configuration.html#ini.magic-quotes-runtime" class="link">magic_quotes_runtime</a></td>
     <td>&quot;0&quot;</td>
     <td>PHP_INI_ALL</td>
     <td>在 PHP 5.4.0 中移除</td>
    </tr>

    <tr>
     <td><a href="info.configuration.html#ini.zend.enable-gc" class="link">zend.enable_gc</a></td>
     <td>&quot;1&quot;</td>
     <td>PHP_INI_ALL</td>
     <td>自 PHP 5.3.0 起有效。</td>
    </tr>

    </tbody>
   
  </table>

  有关 PHP_INI_* 样式的更多详情与定义，见 <a href="configuration.changes.modes.html" class="xref">配置可被设定范围</a>。
 </p>
 
 <p class="para">这是配置指令的简短说明。</p>
 
 <p class="para">
  <dl>
   
    <dt id="ini.assert.active">
     <code class="parameter">assert.active</code>
     <span class="type">bool</span>
    </dt>

    <dd>

     <p class="para">
      激活 <span class="function"><a href="function.assert.html" class="function">assert()</a></span> 断言评测。
     </p>
    </dd>

   

   
    <dt id="ini.assert.bail">
     <code class="parameter">assert.bail</code>
     <span class="type">bool</span>
    </dt>

    <dd>

     <p class="para">
      失败的断言将中止脚本。
     </p>
    </dd>

   

   
    <dt id="ini.assert.warning">
     <code class="parameter">assert.warning</code>
     <span class="type">bool</span>
    </dt>

    <dd>

     <p class="para">
      为每个失败的断言产生一条 PHP 警告信息。
     </p>
    </dd>

   

   
    <dt id="ini.assert.callback">
     <code class="parameter">assert.callback</code>
     <span class="type">string</span>
    </dt>

    <dd>

     <p class="para">
      断言失败后要调用的回调函数。
     </p>
    </dd>

   

   
    <dt id="ini.assert.quiet-eval">
     <code class="parameter">assert.quiet_eval</code>
     <span class="type">bool</span>
    </dt>

    <dd>

     <p class="para">
      在断言表达式执行时 <span class="function"><a href="function.error-reporting.html" class="function">error_reporting()</a></span> 使用当前的设置。如果启用了，在执行时错误将不会被显示（隐式的 
      error_reporting(0)）。如果禁用了，错误将根据 <span class="function"><a href="function.error-reporting.html" class="function">error_reporting()</a></span> 的设置来显示。
     </p>
    </dd>

   

   
    <dt id="ini.assert.exception">
     <code class="parameter">assert.exception</code>
     <span class="type">bool</span>
    </dt>

    <dd>

     <p class="para">
      在断言（assert）失败时产生 <span class="classname"><a href="class.assertionerror.html" class="classname">AssertionError</a></span> 异常。
     </p>
    </dd>

   
   
   
    <dt id="ini.enable-dl">
      <code class="parameter">enable_dl</code>
      <span class="type">bool</span>
    </dt>

    <dd>

     <p class="para">
      该指令允许开启或关闭使用 <span class="function"><a href="function.dl.html" class="function">dl()</a></span> 动态加载 PHP 模块。
     </p>
     <p class="para">
      关闭动态加载的主要原因是为了安全。通过动态加载，有可能忽略所有 
      <a href="ini.core.html#ini.open-basedir" class="link">open_basedir</a> 限制。默认允许动态加载。
     </p>
    </dd>

   

   
    <dt id="ini.max-execution-time">
     <code class="parameter">max_execution_time</code>
      <span class="type">int</span>
    </dt>

    <dd>

     <p class="para">
      这设置了脚本被解析器中止之前允许的最大执行时间，单位秒。这有助于防止写得不好的脚本占尽服务器资源。默认设置为 
      <code class="literal">30</code>。从<a href="features.commandline.html" class="link">命令行</a>运行 PHP 
      时，默认设置为 <code class="literal">0</code>。
     </p>
     <p class="para">
      在非 Windows 系统上，最大执行时间不会影响系统调用和系统操作等。更多细节参见 <span class="function"><a href="function.set-time-limit.html" class="function">set_time_limit()</a></span>。
     </p>
     <p class="para">
      你的 web 服务器也可以有其他超时设置，也有可能中断 PHP 的执行。Apache 有一个
      <code class="literal">Timeout</code> 指令，IIS 有一个 CGI 超时功能。他们默认都是 
      300 秒。更多具体信息参见你的 web 服务器的文档。
     </p>
    </dd>

   

   
    <dt id="ini.max-input-time">
     <code class="parameter">max_input_time</code>
      <span class="type">int</span>
    </dt>

    <dd>

     <p class="para">
      脚本解析输入数据（类似 POST 和 GET）允许的最大时间，单位是秒。它从接收所有数据到开始执行脚本进行测量的。默认设置为
      <code class="literal">-1</code>，意味着使用 <a href="info.configuration.html#ini.max-execution-time" class="link">max_execution_time</a>
      的值做为默认值，如果不想限制，请设置为 <code class="literal">0</code>。
     </p>
    </dd>

   

   
    <dt id="ini.max-input-nesting-level">
     <code class="parameter">max_input_nesting_level</code>
     <span class="type">int</span>
    </dt>

    <dd>

     <p class="para">
      设置 <a href="language.variables.external.html" class="link">输入变量</a> 
      的最大允许嵌套的深度。（例如 <var class="varname"><a href="reserved.variables.get.html" class="classname">$_GET</a></var>、<var class="varname"><a href="reserved.variables.post.html" class="classname">$_POST</a></var>）
     </p>
    </dd>

   

   
    <dt id="ini.max-input-vars">
     <code class="parameter">max_input_vars</code>
     <span class="type">int</span>
    </dt>

    <dd>

     <p class="para">
      接受多少 <a href="language.variables.external.html" class="link">输入的变量</a>（限制分别应用于 $_GET、$_POST 和 
      $_COOKIE 超全局变量）指令的使用减轻了以哈希碰撞来进行拒绝服务攻击的可能性。如有超过指令指定数量的输入变量，将会导致 
      <strong><code>E_WARNING</code></strong> 的产生，更多的输入变量将会从请求中截断。
     </p>
    </dd>

   
   
   
    <dt id="ini.magic-quotes-gpc">
     <code class="parameter">magic_quotes_gpc</code>
     <span class="type">bool</span>
    </dt>

     <dd>

     <div class="warning"><strong class="warning">警告</strong><p class="simpara">本特性已自
PHP 5.3.0 起<em class="emphasis">废弃</em>并将自 PHP 5.4.0
起<em class="emphasis">移除</em>。</p></div>
     <p class="para">
      为 GPC (Get/Post/Cookie) 操作设置 magic_quotes 状态。当 magic_quotes 为 
      on，所有的 &#039;（单引号）、&quot;（双引号）、\（反斜杠）和 NUL 被一个反斜杠自动转义。
     </p>
     <p class="para">
      参见 <span class="function"><a href="function.get-magic-quotes-gpc.html" class="function">get_magic_quotes_gpc()</a></span>。
     </p>
    </dd>

   

   
    <dt id="ini.magic-quotes-runtime">
     <code class="parameter">magic_quotes_runtime</code>
     <span class="type">bool</span>
    </dt>

    <dd>

     <div class="warning"><strong class="warning">警告</strong><p class="simpara">本特性已自
PHP 5.3.0 起<em class="emphasis">废弃</em>并将自 PHP 5.4.0
起<em class="emphasis">移除</em>。</p></div>
     <p class="para">
      如果启用了 <code class="parameter">magic_quotes_runtime</code>，大多数返回任何形式外部数据的函数，包括数据库和文本段将会用反斜线转义引号。   
     </p>
     <p class="para">
      受 <code class="parameter">magic_quotes_runtime</code> 影响的函数（不包括 PECL 里的函数）：
      <ul class="simplelist">
       <li class="member"><span class="function"><a href="function.get-meta-tags.html" class="function">get_meta_tags()</a></span></li>
       <li class="member"><span class="function"><a href="function.file-get-contents.html" class="function">file_get_contents()</a></span></li>
       <li class="member"><span class="function"><a href="function.file.html" class="function">file()</a></span></li>
       <li class="member"><span class="function"><a href="function.fgets.html" class="function">fgets()</a></span></li>
       <li class="member"><span class="function"><a href="function.fwrite.html" class="function">fwrite()</a></span></li>
       <li class="member"><span class="function"><a href="function.fread.html" class="function">fread()</a></span></li>
       <li class="member"><span class="function"><a href="function.fputcsv.html" class="function">fputcsv()</a></span></li>
       <li class="member"><span class="function"><a href="function.stream-socket-recvfrom.html" class="function">stream_socket_recvfrom()</a></span></li>
       <li class="member"><span class="function"><a href="function.exec.html" class="function">exec()</a></span></li>
       <li class="member"><span class="function"><a href="function.system.html" class="function">system()</a></span></li>
       <li class="member"><span class="function"><a href="function.passthru.html" class="function">passthru()</a></span></li>
       <li class="member"><span class="function"><a href="function.stream-get-contents.html" class="function">stream_get_contents()</a></span></li>
       <li class="member"><span class="function"><a href="function.bzread.html" class="function">bzread()</a></span></li>
       <li class="member"><span class="function"><a href="function.gzfile.html" class="function">gzfile()</a></span></li>
       <li class="member"><span class="function"><a href="function.gzgets.html" class="function">gzgets()</a></span></li>
       <li class="member"><span class="function"><a href="function.gzwrite.html" class="function">gzwrite()</a></span></li>
       <li class="member"><span class="function"><a href="function.gzread.html" class="function">gzread()</a></span></li>
       <li class="member"><span class="function"><a href="function.exif-read-data.html" class="function">exif_read_data()</a></span></li>
       <li class="member"><span class="function"><a href="function.dba-insert.html" class="function">dba_insert()</a></span></li>
       <li class="member"><span class="function"><a href="function.dba-replace.html" class="function">dba_replace()</a></span></li>
       <li class="member"><span class="function"><a href="function.dba-fetch.html" class="function">dba_fetch()</a></span></li>
       <li class="member"><span class="function"><a href="function.ibase-fetch-row.html" class="function">ibase_fetch_row()</a></span></li>
       <li class="member"><span class="function"><a href="function.ibase-fetch-assoc.html" class="function">ibase_fetch_assoc()</a></span></li>
       <li class="member"><span class="function"><a href="function.ibase-fetch-object.html" class="function">ibase_fetch_object()</a></span></li>
       <li class="member"><span class="function"><strong>mssql_fetch_row()</strong></span></li>
       <li class="member"><span class="function"><strong>mssql_fetch_object()</strong></span></li>
       <li class="member"><span class="function"><strong>mssql_fetch_array()</strong></span></li>
       <li class="member"><span class="function"><strong>mssql_fetch_assoc()</strong></span></li>
       <li class="member"><span class="function"><a href="mysqli-result.fetch-row.html" class="function">mysqli_fetch_row()</a></span></li>
       <li class="member"><span class="function"><a href="mysqli-result.fetch-array.html" class="function">mysqli_fetch_array()</a></span></li>
       <li class="member"><span class="function"><a href="mysqli-result.fetch-assoc.html" class="function">mysqli_fetch_assoc()</a></span></li>
       <li class="member"><span class="function"><a href="mysqli-result.fetch-object.html" class="function">mysqli_fetch_object()</a></span></li>
       <li class="member"><span class="function"><a href="function.pg-fetch-row.html" class="function">pg_fetch_row()</a></span></li>
       <li class="member"><span class="function"><a href="function.pg-fetch-assoc.html" class="function">pg_fetch_assoc()</a></span></li>
       <li class="member"><span class="function"><a href="function.pg-fetch-array.html" class="function">pg_fetch_array()</a></span></li>
       <li class="member"><span class="function"><a href="function.pg-fetch-object.html" class="function">pg_fetch_object()</a></span></li>
       <li class="member"><span class="function"><a href="function.pg-fetch-all.html" class="function">pg_fetch_all()</a></span></li>
       <li class="member"><span class="function"><a href="function.pg-select.html" class="function">pg_select()</a></span></li>
       <li class="member"><span class="function"><strong>sybase_fetch_object()</strong></span></li>
       <li class="member"><span class="function"><strong>sybase_fetch_array()</strong></span></li>
       <li class="member"><span class="function"><strong>sybase_fetch_assoc()</strong></span></li>
       <li class="member"><span class="function"><a href="splfileobject.fgets.html" class="function">SplFileObject::fgets()</a></span></li>
       <li class="member"><span class="function"><a href="splfileobject.fgetcsv.html" class="function">SplFileObject::fgetcsv()</a></span></li>
       <li class="member"><span class="function"><a href="splfileobject.fwrite.html" class="function">SplFileObject::fwrite()</a></span></li>
      </ul>
     </p>
    </dd>

   

   
    <dt id="ini.zend.enable-gc">
     <code class="parameter">zend.enable_gc</code>
     <span class="type">bool</span>
    </dt>

    <dd>

     <p class="para">
      启用或禁用循环引用记数收集器。
     </p>
    </dd>

   

  </dl>

 </p>
</div></div></div></body></html>